package com.mison.utils;

import java.util.List;

public class Page<T> {

	private int currPage = 1;
	
	private int maxPage;
	
	private int totalCount;
	
	private List<T> list;
	
	private int perPage;

	public int getPerPage() {
		return perPage;
	}

	public void setPerPage(int perPage) {
		this.perPage = perPage;
	}

	public Page(int perPage) {
		this.perPage = perPage;
	}

	public int getCurrPage() {
		return currPage;
	}

	public void setCurrPage(int currPage) {
		this.currPage = currPage;
	}

	public int getMaxPage() {
		return maxPage;
	}

	public void setMaxPage(int maxPage) {
		this.maxPage = maxPage;
	}

	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}

	public int getNextPage() {
		
		if(currPage<maxPage){
			return currPage+1;
		}
		
		return maxPage;
	}

	public int getPrePage() {
		
		if(currPage>1){
			return currPage -1;
		}
		
		return 1;
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}
	
}
